<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	
    protected function _initAutoload(){
        $moduleLoader = new Zend_Application_Module_Autoloader(array(
	        'namespace' => '',
	        'basePath' => APPLICATION_PATH));
        return $moduleLoader;
    }
    protected function _initViewHelpers(){
        $this->bootstrap('layout');
        $layout = $this->getResource('layout');
        $view 	= $layout->getView();

        $view->headTitle()->setSeparator(' - ');
        $view->headTitle('淘车乐');
        
        $view->headMeta()
                ->appendName('viewport', 'width=device-width, initial-scale=1.0')
                ->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8')
                ->appendHttpEquiv('X-UA-Compatible', 'IE=EmulateIE9')
                ->appendName('keywords', '')
                ->appendName('description', '')
                ->appendName('mobile-agent', 'format=html5;url=http://www.taochele.com/');

        $view->headLink()
        		->prependStylesheet('/css/bootstrap-responsive.css')
        		->prependStylesheet('/css/style.css')
                ->prependStylesheet('/css/bootstrap.css')
                ->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => '/img/favicon.ico'));
                
		$view->headScript()
				

                ->prependFile('/js/admin.js')
                ->prependFile('/js/set.js')
                ->prependFile('/js/lazyload.js')
                ->prependFile('/js/common.js')
                ->prependFile('/js/jquery.placeholder.js')
                ->prependFile('/js/bootstrap-confirm.js')
				->prependFile('/js/bootstrap.min.js')
        		->prependFile('/js/jquery.min.js')
				->prependFile('/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',));
		

    }

    protected function _initdb() {  
        //require_once 'Zend/Db.php';  
          
        $params = array (  
                'host' 		=> 'localhost',  
                'username'  => 'root',  
                'password'  => '',  
                'dbname'	=> 'taochele',
        );  
          
        $db = Zend_Db::factory ( 'PDO_MYSQL', $params );  
        $db->query('SET NAMES UTF8');
        // 为所有的Zend_Db_Table对象设定默认的adapter  
        //require_once 'Zend/Db/Table.php';  
        Zend_Db_Table::setDefaultAdapter ( $db );  
    }  
	
    
}

